package com.xian.im.common.model;

import com.xian.im.common.utils.sys.TransferUtil;
import lombok.Data;

import java.lang.reflect.ParameterizedType;

@Data
public abstract class BaseForm<T> {

    private Integer currPage;

    private Integer pageSize;

    public <T> T transfer() {
        return (T) TransferUtil.transfer(this,getTClass());
    }

    private Class<T> getTClass() {
        Class<T> tClass = (Class<T>)((ParameterizedType)getClass().getGenericSuperclass()).getActualTypeArguments()[0];
        return tClass;
    }
}
